<?php
/**
 * Created by PhpStorm.
 * User: kb130
 * Date: 2017/8/21
 * Time: 15:23
 */

namespace util\validate\rules;

/**
 * 最小值限定
 * 如果是数字，则是大小，如果是字符串，则是长度
 * Class Min
 * @package validate\rules
 */
class Min extends BaseRule
{

    public function verify()
    {
        if (is_numeric($this->value)) {
            return $this->params <= $this->value;
        }

        return $this->params <= mb_strlen($this->value);
    }
}